package com.springboot3.test.springboot3testdemo4.demos.web.controller;

import com.fasterxml.jackson.databind.JsonNode;
import com.springboot3.test.springboot3testdemo4.demos.web.service.JsonSchemaValidationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @author： liuziyang
 * @date： 2024/8/23-13:48
 * @description：
 * @modifiedBy：
 * @version: 1.0
 */
@RestController
public class JsonSchemaController {
  private JsonSchemaValidationService service;

  @Autowired
  public void setService(JsonSchemaValidationService service) {
    this.service = service;
  }

  @PostMapping("/test")
  public String validateEvent(@RequestBody JsonNode jsonNode) {
    return service.validateJson(jsonNode);
  }
}
